help ... Info=Info[i];
|
Hereunder the results of the right side cell Script to clearly show by redifining the variables and by adding code how the Interpreter develops the Script instructions.
|
The basic content in the brackets "{}" does not change into the color sections, this page wants to analyze the building and refilling of the arrays. As the interpreter associates the code outputs during the loops'runs , so the code adding method is for comparing the outputs of the Script .
It's interesting to see that the instruction :
document.write('<font color=red>'+the_info+' ...</font>');
does not give any error but marks the spaces'outputs. At the end document.write is required to write the value "" of the empty array ... the_info = new Array() . At this point if we would ask to write the_info[i], then the interpreter would write 3 times : "undefined" right before the red dots ...
To see the output of document.write(Value); ...
Select the next line... :
|
|
<Script language=JavaScript>
<!--
the_info=new Array();
for (i = 0; i < 3; i++) {
var Info = new Array('User','age','tel');//left
document.write('<font color=red>'+the_info+' ...</font>');
Info=Info[i];
document.write(Info);} document.write('<br>')
the_info=new Array();
for (i = 0; i < 3; i++) {
var Info = new Array('User','age','tel');//left
document.write('the_info[i] = '+the_info[i] +'<br>'); }
the_info=new Array();
for (i = 0; i < 3; i++) {
var Info = new Array('User','age','tel');//left
Info=Info[i];document.write(Info);
var Value = new Array('vittorio','53','0881 631796');//right
Value=Value[i];document.write('<font color=navy>'+Value+'</font>')
the_info[Info] = Value;
document.write(the_info[Info])}
//
Just the green code :
-->
</Script>
|